
package com.jf.cloud.supplier.constant;

/**
 * 收支类型 0支出 1收入
 *
 * @author zz
 * @Date 2021/6/10 14:12
 */
public enum SupplierWalletIoType {
    /**
     * 0.支出
     */
    EXPENDITURE(0, "支出"),
    /**
     * 1. 收入
     */
    INCOME(1, "收入"),
    ;

    private final Integer num;
    private final String str;

    public Integer value() {
        return num;
    }

    public String str() {
        return str;
    }

    SupplierWalletIoType(Integer num, String str){
        this.num = num;
        this.str = str;
    }

    public static SupplierWalletIoType instance(Integer value) {
        SupplierWalletIoType[] enums = values();
        for (SupplierWalletIoType typeEnum : enums) {
            if (typeEnum.value().equals(value)) {
                return typeEnum;
            }
        }
        return null;
    }

    public static String getIoName(Integer value) {
        SupplierWalletIoType[] enums = values();
        for (SupplierWalletIoType statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum.str;
            }
        }
        return null;
    }
}
